﻿using System;
using System.Collections.Generic;
using System.Text;

namespace Marmat.Common.Http.JwtBearer
{
    /// <summary>
    /// JwtBearer 的请求过滤器，用于将 Authorization 值提交给服务器。
    /// </summary>
    public class JwtBearerFilterAttribute : ActionFilterAttribute
    {
        public override void OnActionExecuting(ApiActionContext context)
        {
            if (!string.IsNullOrEmpty(JwtBearerConfiguration.Authorization))
                context.Request.Headers["Authorization"] = $"Bearer {JwtBearerConfiguration.Authorization}";
        }
    }

   
}
